<?php require_once 'common/adminHeader.php';?>
<div class="nav">
当前位置：<a href="<?php echo siteUrl('Financemonth/monthlist')?>">财务月账单列表</a>
</div>
<link href="<?php echo WEB_ROOT?>static/css/calender.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" src="<?php echo WEB_ROOT?>static/js/calender.js"></script>
<script language="javascript">
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked = form.chkall.checked;
	}
}

function ctrl(action)
{
	if(action == "export")
	{
		window.open("<?php echo siteUrl('financemonth/monthexportexcel')?>?menu=export","_blank");
		return;
	}

	var form = document.getElementById("form1");
	var sign = false;
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != "chkall" && e.checked) sign = true;
	}

	if(!sign){
		alert("您还没有选择！");
		return;
	}

	if(action =="delCheck"){
		form.action = "<?php echo siteUrl('financemonth/delCheck').'?';?>menu=" + action;
		form.submit();
		return;
	}
	if(action =="exportExcel"){
		form.action = "<?php echo siteUrl('financemonth/monthexportexcel').'?';?>menu=" + action;
		form.submit();
		return;
	}
	
	
}
</script>

<form method="POST" action="">
开始时间:<input name="startTime" type="text" id="beginTime" size="15" maxlength="15" value="" onclick="var obj = $('beginTime'); showcalendar(event, obj, false);" size="15" />
结束时间:<input name="endTime" type="text" id="endTime" size="15" maxlength="15" value="" onclick="var obj = $('endTime'); showcalendar(event, obj, false);" size="15"/>
摘要：<input type="text" value="" name="Description"/>
结存余额：<input type="text" value="" name="Balance"/>
<input type="submit" value="查询" name="submit"/>

</form>
<form name="form1" id="form1" method="post" action="">
<br>
<table class="tableClass"  width="100%"  border="0" cellpadding="0" cellspacing="1">
  <tr>
  	<td width="50"><input type="checkbox" value="ON" onclick="CheckAll(this.form)" name="chkall"></td>
   	<td width="80">日期</td>
    
    <td width="150">收入</td>
    <td width="150">支出</td>
    <td width="150">结存余额</td>
    <td>摘要</td>
    <td width="100">操作</td>
  </tr>
  <?php if ($form_data->list):?>
  <?php foreach ($form_data->list as $key=>$value):?>
	<tr>
		<td><input type="checkbox" value="<?php echo $value['FinanceId'];?>" name="FinanceId[]"></td>
		<td><?php echo date('Y-m-d',strtotime($value['CreateTime']));?></td>
		
		<td><?php echo $value['InMoney'];?></td>
		<td><?php echo $value['OutMoney'];?></td>
		<td><?php echo $value['Balance'];?></td>
		<td><?php echo $value['Description'];?></td>
		<td>
		<a onClick="if (confirm('确定删除?')){return ture;}else{return false;}" href="<?php echo siteUrl('financemonth/monthdel?FinanceId=').$value['FinanceId'];?>">删除</a> 
		<a href="<?php echo siteUrl('financemonth/monthedit?FinanceId=').$value['FinanceId'];?>">编辑</a></td>
	</tr>
   <?php endforeach;  endif;?>
</table>
<br>
<?php echo $form_data->page?>
</form>
<br>

<a onclick="ctrl('exportExcel')" href="#">导出Excel</a>
<a onclick="ctrl('delCheck')" href="#">删除选中的记录</a>
<a href="<?php echo siteUrl('financemonth/monthadd');?> ">添加财务记录</a>
<?php require_once 'common/adminFooter.php';?>